//
//  HomePageHeaderView.m
//  Taste
//
//  Created by 徐昊 on 16/9/1.
//  Copyright © 2016年 徐昊. All rights reserved.
//

#import "HomePageHeaderView.h"
#import "Masonry.h"


@implementation HomePageHeaderView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        [self config];
    }
    return self;
}
- (void)config {
    _title = [UILabel new];
    [self addSubview:_title];
    _title.font = [UIFont systemFontOfSize:18.0];
    _title.text = @"label";
    [_title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(25);
        make.centerY.mas_equalTo(0);
//        make.width.mas_equalTo(100);
//        make.height.mas_equalTo(20);
    }];
    UIView *red = [UIView new];
    [self addSubview:red];
    red.backgroundColor = [UIColor redColor];
    [red mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(_title.mas_left).mas_offset(-5);
        make.top.mas_equalTo(_title.mas_top).mas_offset(0);
        make.bottom.mas_equalTo(_title.mas_bottom).mas_offset(0);
        make.width.mas_equalTo(10);
    }];
    UILabel *label = [UILabel new];
    [self addSubview:label];
    label.text = @"更多";
    label.font = [UIFont systemFontOfSize:15];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-15);
        make.centerY.mas_equalTo(0);
//        make.width.mas_equalTo(70);
//        make.height.mas_equalTo(50);
    }];
    UIImageView *image = [UIImageView new];
    [self addSubview:image];
    image.image = [UIImage imageNamed:@"LZImg_Firstpage_More"];
    [image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(label.mas_right).mas_offset(0);
        make.centerY.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(20);
    }];
}

@end
